<template>
  <div>
    <div class="mui-numbox" data-numbox-min="1">
      <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
      <input
        id="test"
        class="mui-input-numbox"
        type="number"
        :value="initcount"
        @change="CountChange"
        ref="numbox"
        readonly
      />
      <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
  </div>
</template>

<script>
import mui from "../../../node_modules/mui-master/examples/hello-mui/js/mui.min";
export default {
    mounted() {
        mui('.mui-numbox').numbox();
    },
    methods: {
        CountChange(){
            this.$store.commit("Update",{
                id: this.goodsid,
                count : this.$refs.numbox.value
            })
        }
    },
    props:[
        "initcount",
        "goodsid"
    ]
};
</script>

<style scoped>
</style>